﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

public partial class controls_login_SecurityQuestion : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    private void SelectSecurityQuestion(string text)
    {
        foreach (RadComboBoxItem item in rcbSecurityQuestion.Items)
        {
            if (item.Text == text)
            {
                rcbSecurityQuestion.SelectedValue = item.Value;
                break;
            }
        }
    }

    public string SelectedSecurityQuestion
    {
        get
        {
            string securityQ = string.Empty;
            if (rcbSecurityQuestion.SelectedIndex > 0)
            {
                securityQ = rcbSecurityQuestion.SelectedValue;

            }
            else
            {
                securityQ = rcbSecurityQuestion.Text.Trim();
            }

            return securityQ;
        }

        set
        {
            SelectSecurityQuestion(value);
        }
    }

    public string SecurityAnswer
    {
        get
        {
            return tbSecurityAnswer.Text.Trim();
        }
        set
        {
            tbSecurityAnswer.Text = value;
        }
    }

    public bool Enabled
    {
        get
        {
            return tbSecurityAnswer.Enabled;
        }
        set
        {
            tbSecurityAnswer.Enabled = value;
            rcbSecurityQuestion.Enabled = value;

        }
    }
}